//
//  Result.m
//  Surveyer
//
//  Created by Qikun Guo on 13-8-17.
//  Copyright (c) 2013年 Tim. All rights reserved.
//

#import "Result.h"
#import "Survey.h"
#import "SurveyItem.h"


@implementation Result

@dynamic surveyTitle;
@dynamic text;
@dynamic number;
@dynamic item;
@dynamic survey;
@dynamic completed;

- (NSString *)formattedText
{
    SurveyItem *item = self.item;
    NSString *type = item.type;
    if ([type isEqualToString:@"Binary"] || [type isEqualToString:@"Picker"])
    {
        return [item valueForKey:[NSString stringWithFormat:@"value%d",(self.text.intValue+1)]];
    }
    else if ([type isEqualToString:@"Multi TF"])
    {
        return @"CODE NOT IMPLEMENTED";
    }
    return self.text;
}
@end
